/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("tb_project_apply_basicinfo",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using MYData.Entity.DomainModels;
using MYData.System.IServices;
using System.Net;
using MYData.Core.Utilities;
using MYData.Entity.DomainModels.ApiEntity.detail;
using MYData.Entity.DomainModels.ApiEntity.Input;
using Microsoft.AspNetCore.Authorization;
using MYData.Core.Extensions;
using MYData.Core.Utilities;
using System.IO;

namespace MYData.System.Controllers
{
    public partial class tb_project_apply_basicinfoController
    {
        private readonly Itb_project_apply_basicinfoService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public tb_project_apply_basicinfoController(
            Itb_project_apply_basicinfoService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }
        /// <summary>
        /// 根据附件表主键显示基础信息表+附件表详情信息
        /// </summary>
        /// <returns></returns>
        [HttpGet, Route("GetDetail")]
        [AllowAnonymous]
        public async Task<object> GetDetail(string id)
        {
            return await _service.GetDetail(id);
        }
        /// <summary>
        /// 根据基础信息表主键显示详情信息
        /// </summary>
        /// <returns></returns>
        [HttpGet, Route("basicDetail")]
        [AllowAnonymous]
        public async Task<object> basicDetail(string id)
        {
            return await _service.basicDetail(id);
        }
        /// <summary>
        /// 项目列表显示
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpPost, Route("GetBasicInfo"),AllowAnonymous]
        public async Task<object> GetBasicInfo(string? projectName = "")
        {
            return await _service.GetBasicInfo(projectName);
        }
        ///// <summary>
        ///// 逻辑删除申报基础信息表+附件表
        ///// </summary>
        ///// <param name="id"></param>
        ///// <returns></returns>
        [HttpPost, Route("DeleteBasicinfoorAppendix")]
        public async Task<WebResponseContent> DeleteBasicinfoorAppendix(string id)
        {
            return await _service.DeleteBasicinfoorAppendix(id);
        }
        /// <summary>
        /// 修改申报基础信息表+附件表
        /// </summary>
        /// <param name="detaildto"></param>
        /// <returns></returns>
        [HttpPost, Route("UpdateBasicinfoorAppendix")]
        public async Task<WebResponseContent> UpdateBasicinfoorAppendix([FromForm]BasicinfoorAppendixDetail_Dto detaildto)
        {
            return await _service.UpdateBasicinfoorAppendix(detaildto);
        }
        /// <summary>
        /// 添加申报基础信息表+附件表
        /// </summary>
        /// <param name="inputdto"></param>
        /// <returns></returns>
        [HttpPost, Route("AddBasicinfoorAppendix")]
        [AllowAnonymous]
        public async Task<WebResponseContent> AddBasicinfoorAppendix([FromBody]BasicinfoorAppendixInput_Dto inputdto)
        {
            return await _service.AddBasicinfoorAppendix(inputdto);
        }
        /// <summary>
        /// 专家评审页面项目数据显示
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet("ExpertInfo")]
        public async Task<WebResponseContent> ExpertInfo(string id)
        {
            return await _service.ExpertInfo(id);
        }
    }
}
